import java.util.Scanner;

public class Console {

    public static double readNumber(String prompt, double min, double max) {
        Scanner scanner = new Scanner(System.in);
        double value;
        while (true) {
            System.out.print(String.format("请输入%s（%.0f-%.0f）", prompt, min, max));
            value = scanner.nextDouble();
            if (value >= min && value <= max)
                break;
            System.out.println(String.format("请输入%.0f到%.0f之间的数字", min, max));
        }
        // scanner.close();
        return value;
    }
    
}
